<?php

class Home extends CI_Controller {
	
	public function __construct() {
		parent::__construct();
	}
	
	public function index(){
		$this->load->model('Patient','p');
		$this->load->model('Nutritionist','n');
		$data['title'] = 'NutriApp';
		
		if($this->p->is_logged()){
			$data['email']          = $this->session->userdata('email_p');
			$this->load->view('index', $data);	
		}else if($this->n->is_logged()){
			$data['id_nutritionist'] = $this->session->userdata('id_n');
			$data['email'] = $this->session->userdata('email_n');
			$this->load->view('index_admin', $data);
		}else redirect('/login', 'refresh');
	}
}

/* End of file home.php */
/* Location: ./nutri/application/controllers/home.php */